<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$CI =& get_instance();
/**
 * UTF8截取函数，不带省略号
 *
 * @access: public
 * @author: afei
 * @param: string，$str，原字符串
 * @param: int，$len ，截取的长度
 * @return: string
 *
 *  页面调用：
 * $this->load->helper('function');
 * utf_substr($str,$len);
 */
function utf_substr($str,$len){
	$new_str=mb_substr($str,0,$len,"utf-8");
    return $new_str;
}

/**
 * 判断是否提交的函数
 *
 * @access: public
 * @author: afei
 * @param: $sub，提交按钮的name
 * @return: boll
 *
 *  页面调用：
 * $this->load->helper('function');
 * issubmit("member_sub");
 */
function issubmit($sub){
	$submit=$_POST["$sub"];
	return isset($submit);
}

/**
 * 弹出post表单的最后一个元素：一般情况就是submit
 **
 * @access: public
 * @author: afei
 * @param: 无
 * @return: array
 *
 *  页面调用：
 * $this->load->helper('function');
 * pop_post();
 */
function pop_post(){
	$req=$_POST;
	array_pop($req);
	return $req;
}


?>